<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								流水类型：<select name="cashType" th:with="type=${@dict.getType('pay_cash_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								创建用户：<input type="text" name="createId"/>
							</li>

							<li>
								关联用户：<input type="text" name="otherId"/>
							</li>

							<li>
								币种：<input type="text" name="currency"/>
							</li>

							<li>
								金额：<input type="text" name="usdtNum"/>
							</li>

							<li>
								法币金额：<input type="text" name="currencyNum"/>
							</li>

							<li>
								商户入金金额：<input type="text" name="aerchantNum"/>
							</li>

							<li>
								数量：<input type="text" name="usdtNo"/>
							</li>

							<li>
								手续费：<input type="text" name="plantFee"/>
							</li>

							<li>
								手续费率：<input type="text" name="plantFeeRate"/>
							</li>

							<li>
								代理抽成：<input type="text" name="agentFee"/>
							</li>

							<li>
								代理抽成费率：<input type="text" name="agentFeeRate"/>
							</li>

							<li>
								兑商抽成：<input type="text" name="acceptFee"/>
							</li>

							<li>
								商户入金汇率上调：<input type="text" name="aerchantFeeRate"/>
							</li>

							<li>
								商户抽成：<input type="text" name="aerchantFee"/>
							</li>

							<li>
								火币汇率：<input type="text" name="usdtRate"/>
							</li>

							<li>
								入金汇率：<input type="text" name="plantRate"/>
							</li>

							<li>
								流水状态：<select name="cashState" th:with="type=${@dict.getType('pay_cash_state')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>更新时间： </label>
								<input type="text" class="time-input" id="startUpdateTime" placeholder="开始" name="params[beginUpdateTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endUpdateTime" placeholder="结束" name="params[endUpdateTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="pay:accout:cash:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="pay:accout:cash:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="pay:accout:cash:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="pay:accout:cash:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('pay:accout:cash:edit')}]];
        var removeFlag = [[${@permission.hasPermi('pay:accout:cash:remove')}]];
        var prefix = ctx + "pay/accout/cash";
        var payCashDir = [[${@dict.getType('pay_cash_type')}]];
        var payCashStateDir = [[${@dict.getType('pay_cash_state')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "账户流水",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'cashId', 
					title : '',
					visible: false
				},
				{
					field : 'cashType', 
					title : '流水类型',
					sortable: true,
					formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(payCashDir, value);
		            }
				},
				{
					field : 'createId', 
					title : '创建用户',
					sortable: true
				},
				{
					field : 'otherId', 
					title : '关联用户',
					sortable: true
				},
				{
					field : 'currency', 
					title : '币种',
					sortable: true
				},
				{
					field : 'usdtNum', 
					title : '金额',
					sortable: true
				},
				{
					field : 'currencyNum', 
					title : '法币金额',
					sortable: true
				},
				{
					field : 'aerchantNum', 
					title : '商户入金金额',
					sortable: true
				},
				{
					field : 'usdtNo', 
					title : '数量',
					sortable: true
				},
				{
					field : 'plantFee', 
					title : '手续费',
					sortable: true
				},
				{
					field : 'plantFeeRate', 
					title : '手续费率',
					sortable: true
				},
				{
					field : 'agentFee', 
					title : '代理抽成',
					sortable: true
				},
				{
					field : 'agentFeeRate', 
					title : '代理抽成费率',
					sortable: true
				},
				{
					field : 'acceptFee', 
					title : '兑商抽成',
					sortable: true
				},
				{
					field : 'aerchantFeeRate', 
					title : '商户入金汇率上调',
					sortable: true
				},
				{
					field : 'aerchantFee', 
					title : '商户抽成',
					sortable: true
				},
				{
					field : 'usdtRate', 
					title : '火币汇率',
					sortable: true
				},
				{
					field : 'plantRate', 
					title : '入金汇率',
					sortable: true
				},
				{
					field : 'cashState', 
					title : '流水状态',
					sortable: true,
					formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(payCashStateDir, value);
		            }
				},
				{
					field : 'updateTime', 
					title : '更新时间',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.cashId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.cashId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>